<template>
  <view class="container">
<!-- 	  <z-nav-bar></z-nav-bar> -->
<z-nav-bar backState='3000' @backClick='backClick' type='transparent' :titleCenter='true' title=''></z-nav-bar>
	  <!-- 公共组件-每个页面必须引入 -->
	  <public-module></public-module>
    <!-- <image class="bg-image" src="@/static/dati/login.png" mode="widthFix"></image> -->
    <view class="content">
      <input class="input-box" v-model="obj.unit" placeholder="请输入单位名称"></input>
      <input class="input-box" v-model="obj.name" placeholder="请输入姓名"></input>
      <button class="login-btn" @click="submit">提&nbsp;&nbsp;&nbsp;交</button>
    </view>
  </view>
</template>

<script>
import $http from '@/config/requestConfig'
export default {
	data() {
		return {
			obj:{
				code:"123456",
				name:'',
				unit:""
			}
		};
	},
	//第一次加载
	onLoad(e) {
		if(uni.getStorageSync('quizProgress')){
			uni.navigateTo({
				url:`/pages/dati/tm`
			})
		}
		
		// 隐藏原生的tabbar
		uni.hideTabBar();
	},
	//页面显示
	onShow() {
		
		// 隐藏原生的tabbar
		uni.hideTabBar();
	},
	//方法
	methods: {
		submit(){
			if(!this.obj.unit){
				uni.showToast({
					title:'请输入单位名称',
					icon: "none"
				});
				return
			}
			if(!this.obj.name){
				uni.showToast({
					title:'请输入姓名',
					icon: "none"
				});
				return
			}
			uni.navigateTo({
							url:`/pages/dati/one_dt?name=${this.obj.name}&unit=${this.obj.unit}`
						})
		}
	},
	//页面隐藏
	onHide() {},
	//页面卸载
	onUnload() {},
	//页面下来刷新
	onPullDownRefresh() {},
	//页面上拉触底
	onReachBottom() {},
	//用户点击分享
	onShareAppMessage(e) {
		
	}
};
</script>

<style scoped>
.uni-input-placeholder{
	color: #646464;
	letter-spacing: 1px;
	font-size: 17px;
	font-weight: 500;
}
.container {
	background-image: url('../../static/dati/login.png');
	background-position: center; /* 图片居中 */  
	  background-repeat: no-repeat; /* 不重复 */  
	  background-size: cover; /* 覆盖整个元素，保持宽高比 */  
	  background-attachment: fixed; /* 可选，使背景图在滚动时不滚动 */
	  height: 100vh;
  position: relative;
  width: 100%;
  /* height: 100vh; */
  display: flex;
  justify-content: center;
  align-items: center;
}

.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image fills the entire background */
  z-index: -1;
}

.content {
  width: 90%;
  text-align: center;
}

.welcome-text {
  font-size: 24px;
  color: #333;
  margin-bottom: 20px;
}

.input-box {
  width: 100%;
  height: 50px;
  border-radius: 25px;
  margin-bottom: 20px;
  /* padding: 0 10px; */
  /* background: transparent; */
  border: 1px solid  rgba(0, 0, 0, 0.1);
  color:#000;
  /* box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.1); */
}

.login-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(to right, #38b448, #1c8c55);
  border-radius: 25px;
  color: white;
  font-size: 18px;
  line-height: 50px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
</style>
